#pragma  once
#include <Windows.h>
#include <io.h>
#define  NULL 0


#define PI	3.14159265358979
#define MU0 (4*PI*1e-7)
#define feReal double

#define MF_FILENAME_ZU			"mainfield_zu.dat"
#define MF_FILENAME_ZDUDT		"mainfield_zdudt.dat"
#define MF_FILENAME_XU			"mainfield_xu.dat"
#define MF_FILENAME_XDUDT		"mainfield_xdudt.dat"
#define MF_FILENAME_MESH		"mainfield_mesh.dat"
#define MF_INFINITY_H 10000


struct fePoint
{
	feReal X;

public:
	fePoint operator + (fePoint iSecond) { fePoint p; p.X = X + iSecond.X; return p; }
	fePoint operator / (double iAlpha) { fePoint p; p.X = X/iAlpha; return p; }
	fePoint operator * (double iAlpha) { fePoint p; p.X = X*iAlpha; return p; }
	
	fePoint(double iX) { X = iX; }
	fePoint() {X = -1; }

	static bool Less(const fePoint &iP1, const fePoint &iP2)
	{
		return iP1.X < iP2.X;
	}
  //feReal Y;
  //feReal Z;
};


//---------------------------------------------------------------------------------------------------------------------------------------------
inline bool gFileExists(const char *iFileName)
{
	return access(iFileName,0) != -1;
}